﻿@extends('user.layouts.head')
@section('content')
@inject('cookie', 'Illuminate\Support\Facades\Cookie')
    <style>
        .qiang-btn, .qiang-btn-dis, list-inline {
            display: inline-block;
            padding: 0 15px;
            background-color: red;
            color: #fff;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border-radius: 3px;
        }
        .qiang-btn-dis {
            background-color: #c8cbcf;
        }
        .web-tool {
            margin-top: 10px;
            float: left;
        }
        .web-tool a {
            float: left;
            margin-left: 10px;
            color: #f3ef0a;
        }
        .textbox p {
            font-size: 16px;
        }
        .banner-ad-con {
            width: 1440px;
            margin: 0 auto;
            padding-top: 40px;
        }
        .banner-ad {
            width: 100%;
            display: flex;
            justify-content: space-between;
        }
        .banner-logo {
            width:352px;
            height:194px;
            background: url("../images/bgi-logo.png") no-repeat top center;
            z-index:1000;
        }
        .text-top {
            width:794px;
            height:205px;
            background: url("../images/text-top.png") no-repeat top center;
            z-index:1000;
        }
        .text-bottom {
            width:957px;
            height:277px;
            background: url("../images/text-bottom.png") no-repeat top center;
            z-index:1000;
        }
        .banner-bottom {
            margin-top: 40px;
            width: 100%;
            display: flex;
            justify-content: space-between;
        }
        .login-mobile-btn {
            text-align: center;
            width: 40%;
            margin: 10px auto;
            height: 35px;
            line-height: 35px;
            cursor: pointer;
            border-radius: 4px;
            background-color: #409EFF;
            color: #eee;
        }
        .rightbar2 {
            width: 210px;
            height: 0px;
            position: fixed;
            right: 0px;
            bottom: 50px;
            background: url(../images/hezi.png) no-repeat left top;
            padding: 200px 10px 0px 0px;
            z-index: 132;
            text-align: center;

            color: #000;
            -o-transition: all .5s;
            -webkit-transition: all .5s;
            -moz-transition: all .5s;
            -ms-transition: all .5s;
            transition: all .5s;
        }
        .rightbar2 .downlist {
            float: left;
            margin-top: -90px;
            margin-left: 4px;
            padding-left: 15px;
        }
        .rightbar2 .downlist li a {
            float: left;
            width: 200px;
            height: 40px;
            position: relative;
            text-indent: -9999em;
            display: block;
            margin-left: 0px;
            margin-top: -30px;
            background: url(../images/down1.png) no-repeat left top;
            background-size: 100%;
            padding-left: 5px;
        }



        .login-box {
            width: 21%;
            height: 290px;
            /* background: url('https://x5q.oss-cn-beijing.aliyuncs.com/static/images/login-bg.png') no-repeat; */
            background-size: cover;
            /* background-color: #FFFFFF; */
            border-radius: 5px;
            margin-left: 5px;
            margin-right: 8px;

            text-align: center;
            box-sizing: border-box;
            background: #FFFFFF;
            /* position: relative; */
        }

        .login-box .no-login {
            margin-top: 66px;
            position: relative;
            /*display: none;*/
        }
        .login-box .login{
            /* display: none; */
        }
        .login-box .logo-info {
            display: flex;
            justify-content: center;
        }

        .login-box .no-login {

        }

        .login-box .no-login .logo-info {
            display: flex;
            margin-top: -10px;
            margin-bottom: 10px;
        }

        .login-box .no-login .logo-info .logo {
            border-radius: 50%;
            width: 65px;
            height: 65px;
        }

        .login-box .no-login .logo-info .logo-info-col {
            display: flex;
            flex-direction: column;
            justify-content: center;
            margin: 0 18px;
            text-align: center;
        }

        .login-box .no-login .logo-info .logo-info-col h3 {
            font-weight: bold;
            line-height: 28px;
            margin: 20px 0 0;
        }

        .login-box .no-login .logo-info .logo-info-col h4 {
            margin-top: 0px;
            margin-bottom: 0px;

        }

        .login-box .no-login .title {
            text-align: center;
            font-size: 15px;
            margin: 10px 0;
            line-height: 20px;
        }

        .login-box .no-login .tip {
            color: #888888;
            text-align: center;
            font-size: 13px;
        }
        .login-sm-btn {
            padding: 14px 16px;
            background-color: #f78d04;
            color: #fff;
            cursor: pointer;
            width: 200px;
            margin: 0 auto;
            font-size: 14px;
            border-radius: 4px;
        }
    </style>

<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?4694732e26835e317d3440942aeae59a";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>

<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"Jzof5zCScdGYR7IV",ck:"Jzof5zCScdGYR7IV"})</script>
<body style="height: 100%">
<!-------顶部-------->
<div class="wrap header">

    <!-------导航-------->
    <div class="tw-nav">
    <div class="main">
        <div class="nav-logo"><a href="#" title="乐享游" style="background:url(images/logo.jpg) center no-repeat;width: 350px;"></a></div>

        <ul id="nav-box" class="nav nav-box">
            <li class="cur"><i class=" ico01"></i><a href="#today-gift-list">推荐版本</a></li>
            <li class="cur"><i class=" ico03"></i><a href="#fuli-gift-list">全民福利版本</a></li>

	    <!--<li class="iphone-game fr_02"><i class=" ico03"></i><a href="#fuli" >全民福利版本</a></li>-->
	    <!--<li class="iphone-game fr_01"><i class=" ico02"></i><a href="javascript:;">今日首推</a></li>-->
{{--	                <li class="cur"><i class=" ico02"></i><a href="#st-gift-list">今日首推</a></li>--}}
	                <li class="cur go-recharge-btn"><i class=" ico05"></i><a href="javascript:;">网站余额充值</a></li>
	                <li class="cur go-dh-btn"><i class=" ico06"></i><a href="javascript:;">余额兑换游戏</a></li>

                    <li><i class=" ico04"></i><a href="{{route("hijack", '')}}" target="_blank">防劫持教程</a></li>
{{--                    <li><i class=" ico05"></i><a href="#" target="_blank">礼包领取教程</a></li>--}}
            <div class="nav-line"><i></i></div>
        </ul>

    </div>
        <script>
            function setIndex() {
                layer.open({
                    content: "抱歉！您的浏览器不支持设置首页！<br> 您可以手动将'https://l3y.cn/'设置成为首页"
                })
            }

            function faviorSite() {
                layer.open({
                    content: "您可以通过快捷键CTRL + D加入收藏夹"
                })
            }

            function moveTable() {
                layer.open({
                    content: "敬请期待"
                })
            }
        </script>
</div>    <!-------导航end-------->
</div>
<!-------顶部end-------->

<!-------页面主体-------->
<div class="wrap g-wrap" style="background-image:url(/images/bgi.png); background-size: 100% 800px; background-repeat: no-repeat;">


    <div class="web-tool">
        <a href="javascript:;" onclick="setIndex()">❤设为首页</a>&nbsp;&nbsp;
        <a href="javascript:;" onclick="faviorSite()">★收藏本站</a>&nbsp;&nbsp;
        <a href="/downloadLink" onclick="moveTable">➤放于桌面</a>
        @if(!$is_login)
        <a href="javascript:;" onclick="openLoginWin()">登录</a>
        @else
        <a href="javascript:;" onclick="openBindMobilePage()">绑定手机</a>
        @endif
    </div>
    <div class="banner-ad-con">
        <div class="banner-ad">
            <div class="banner-logo"></div>
            <!--<div class="text-top" ></div>-->
{{--            <div class="erweima1"><img src="images/gongzhonghao.jpg" alt="扫码关注公众号" width="120" height="120"></div>--}}

                <div class="login-box">
                    <div class="no-login">
                        <h3 style="color: #f78d04;margin-bottom: 40px;margin-top: -35px;font-size: 20px;">会员中心登录</h3>

                        <div class="logo-info">
                            @if(!$is_login)
                                <img class="logo" src="https://x5q.oss-cn-beijing.aliyuncs.com/static/images/btx.png"
                                     alt="">
                            @else
                                <img class="logo" src="/images/uc/login_img.png"
                                     alt="">
                            @endif


                        </div>
                        <div class="title">{{$is_login ? $user_info->username : '登录会员享网站充值优惠'}}</div>
                        @if($is_login)
                            <div class="tip">ID: {{$user_info->unionid}}</div>
                        @endif

                        <div class="btn-box" style="text-align:center;margin-top: 10px;">
                            @if(!$is_login)
                            <div type="button" class="login-sm-btn" id="WeChatLogin">微信扫码登录</div>
                            @else
                            <div type="button" class="login-sm-btn" id="outLogin">退出登录</div>
                            @endif
                        </div>

                    </div>
                </div>
        </div>
        <div class="banner-bottom">
            <div class="text-bottom" ></div>
{{--            --}}
            <div id="zhuanpan">
                <div class="rotate-con-pan">
                    <div class="rotate-con-zhen"></div>
                </div>
            </div>
        </div>

    </div>
{{--    <div class="erweima1"><img src="images/qqqun.png" alt="扫码加入Q群" width="120" height="120"></div>--}}

        <!-------&幸运转盘------->

        <!-------&幸运转盘end-------->


    <!-------banner-------->
<!--<div id="slideBox" class="slideBox">

{{-- --}}


        <div class="hd">
            <ul>
            <li><em></em></li><li><em></em></li><li><em></em></li><li><em></em></li><li><em></em></li>
          </ul>
        </div>
        <div class="bd">
            <ul>
                                <li><img src="images/bg01.jpg" alt="背景标题随便写" title="背景标题随便写" /></li>
                                <li><img src="images/bg02.jpg" alt="背景标题随便写" title="背景标题随便写" /></li>
                                <li><img src="images/bg03.jpg" alt="背景标题随便写" title="背景标题随便写" /></li>
                                <li><img src="images/bg04.jpg" alt="背景标题随便写" title="背景标题随便写" /></li>
                                <li><img src="images/bg05.jpg" alt="背景标题随便写" title="背景标题随便写" /></li>
            </ul>
        </div>
        <a class="prev" href="javascript:void(0)" target="_self"></a>
        <a class="next" href="javascript:void(0)" target="_self"></a>
    </div>-->
    <!-------banner end-------->

    <!-------中间部分-------->
    <div class="main content">


        <!-------&旗帜-------->
        <!--<div class="mod2 mb35">
                   <li class="tpgame01" >
                           <div class="textbox">
                                 <div class="icon01">
                                      <h2>万千玩家选择</h2>
                                                <p>万千玩家选择，海量新服推荐，让您的选择不再孤单</p>
                                  </div>
                           </div>
                                 <a class="tpbtn01"  href="#"   target="_blank" >L3Y-乐享游</a>
                   </li>
                   <li class="tpgame02" >
                           <div class="textbox">
                                 <div class="icon02">
                                      <h2>品牌推荐</h2>
                                                <p>品牌保证，官方推荐出现跑路，平台将负责为玩家兑换回收</p>
                                  </div>
                           </div>
                                 <a class="tpbtn02"  href="#"   target="_blank" >L3Y-乐享游</a>
                   </li>
                   <li class="tpgame03" >
                           <div class="textbox">
                                 <div class="icon03">
                                      <h2>平台保障</h2>
                                                <p>有保障的好游戏，彻底告别跑路服，让您安心来打金激情</p>
                                  </div>
                           </div>
                                 <a class="tpbtn03"  href="#"   target="_blank" >L3Y-乐享游</a>
                   </li>
                   <li class="tpgame04" >
                           <div class="textbox">
                                 <div class="icon04">
                                      <h2>福利大服</h2>
                                                <p>新服多多，福利多多，各种福利版本，只有你想不到的，没有找不到的</p>
                                  </div>
                           </div>
                                 <a class="tpbtn04"  href="#"   target="_blank" >L3Y-乐享游</a>
                   </li>
        </div> -->

        <!-------&旗帜end-------->


        <!-------&推荐-------->
        <div class="mod mb35"id="st-gift-list" >
            <div class="kf-news-tit">
                <span class="kf-news-h3 fl">今日强档开区推荐</span>
            </div>
            <ul class="fix" style="display: flex;flex-wrap: nowrap;justify-content: center;">

                @foreach($today['top_games'] as $data)
                    <li class="hbgame" >
                        <div class="c-wt-img fl">
                            <!-- c-wt-new c-wt-hot -->
                            <em class="c-wt-dudai"></em>
                            <i><img src="/uploads/{{$data->image}}" alt="{{$data->server_name}}" width="290" height="280" /></i>
                            <div class="zhez">
                                <a href="{{$data->login_down}}" class="zhez-ksyx">登录器下载</a>
                                <span><a href="{{$data->url}}" target="_blank" title="官网网站">进入官网</a>|<a href="{{$data->kf_url}}" target="_blank" title="在线客服">在线客服</a></span>
                            </div>
                        </div>
                        <div class="c-wt-txt fl">
                            <div class="c-wt-top">
                                <a href="{{$data->url}}" target="_blank" class="c-wt-a">
                                    <em>{{$data->server_name}}</em>
                                    <i></i>
                                </a>
                            </div>
                            <p class="c-wt-xfq">开服时间：{!! getOpenServerTime($data) !!}</p>
                            <p class="c-wt-xfq">游戏类型：{{$data->server_ip}}</p>
                            <a href="{{$data->url}}" target="_blank" class="starbtn">开始游戏</a>
                        </div>
                    </li>
                @endforeach

            </ul>



        </div>
        <!-------&推荐end-------->



        <!-------其他版本，单个可复制无限拓展-------->
        <div style="padding-bottom: 120px;">
            <div class="other-game mt35" id="today-gift-list">
                 <div class="kf-news-tit">
                    <span class="kf-news-h3 fl">今日开服列表推荐</span>
                </div>
                <div class="other-game-box">

                      <table class="tab1" width="1380px" border="0" cellpadding="0" cellspacing="0" >
                        <tr>
                            <td class="bg_1">游戏名称</td>
                            <td class="bg_2">版本类型</td>
                            <td class="bg_3">开区时间</td>
                            <td class="bg_4">推荐星级 </td>
                            <td class="bg_5">游戏简介</td>
                            <td class="bg_6">福利</td>
{{--                        <td class="bg_7">领取记录</td>--}}
                            <td class="bg_8">游戏入口</td>
                        </tr>

                        @foreach($today['unpublished'] as $data)
                            @if($data->is_top == 0)
                                <tr>
                                    <td class="bg_11"><span>{{$data->server_name}}</span></td>
                                    <td class="bg_22"><span>{{$data->server_ip}}</span></td>
                                    <td class="bg_33">
                            <span>
                                {!! getOpenServerTime($data) !!}
                            </span>
                                    </td>
                                    <td class="bg_44"><span>{{str_repeat('★', $data->stars)}}</span></td>
                                    <td class="bg_55"><span>{{$data->introduction}}</span></td>
                                    <td class="bg_66">
                            <span>
                                {{$data->money}}&nbsp;&nbsp;
                                @if($data->count)
                                    数量：{{$data->get_num}}/{{$data->count}}
                                    @if($data->count > $data->get_num)
                                        <a href="javascript:void(0);" class="qiang-btn" onclick="getOpenDate({{$data->id}},'{{$data->server_name}}','{{$data->money}}', {{$data->count}}, {{$data->get_num}})"> 开抢 </a>
                                    @else
                                        <a href="javascript:void(0);" class="qiang-btn-dis"> 已抢完 </a>
                                    @endif
                                @endif
                            </span>
                                    </td>
{{--                                    <td class="bg_77">--}}
{{--                                        <a href="{{ route('userLog', '') . '/' . $data->id }}" class="qiang-btn" target="_blank"> 领取记录 </a>--}}
{{--                                    </td>--}}
                                    <td class="bg_88"><a class="starbtn2" href="{{$data->url}}" target="_blank" >进入游戏</a></td>
                                </tr>
                            @endif
                        @endforeach

                    </table>



                </div>
                <div style="clear:both;"></div>
            </div>

            <div class="other-game mt35" id="fuli-gift-list">
                  <div class="kf-news-tit">
                    <span class="kf-news-h3 fl">全民福利版本  (充值超过50的部分,找客服退)</span>
                </div>
                <div class="other-game-box">








                    <table class="tab1" width="1380px" border="0" cellpadding="0" cellspacing="0" >
                        <tr>
                            <td class="bg_1">游戏名称</td>
                            <td class="bg_2">版本类型</td>
                            <td class="bg_3">开区时间</td>
                            <td class="bg_4">推荐星级 </td>
                            <td class="bg_5">游戏简介</td>
                            <td class="bg_6">福利</td>
                            <!--<td class="bg_7">领取记录</td>-->
                            <td class="bg_8">游戏入口</td>
                        </tr>
                        @foreach($today['unpublished'] as $data)
                            @if($data->is_top < 0)
                                <tr>
                                    <td class="bg_11"><span>{{$data->server_name}}</span></td>
                                    <td class="bg_22"><span>{{$data->server_ip}}</span></td>
                                    <td class="bg_33">
                            <span>
                                {!! getOpenServerTime($data) !!}
                            </span>
                                    </td>
                                    <td class="bg_44"><span>{{str_repeat('★', $data->stars)}}</span></td>
                                    <td class="bg_55"><span>{{$data->introduction}}</span></td>
                                    <td class="bg_66">
                            <span>
                                {{$data->money}}&nbsp;&nbsp;
                                @if($data->count)
                                    数量：{{$data->get_num}}/{{$data->count}}
                                    @if($data->count > $data->get_num)
                                        <a href="javascript:void(0);" class="qiang-btn" onclick="getOpenDate({{$data->id}},'{{$data->server_name}}','{{$data->money}}', {{$data->count}}, {{$data->get_num}})"> 开抢 </a>
                                    @else
                                        <a href="javascript:void(0);" class="qiang-btn-dis"> 已抢完 </a>
                                    @endif
                                @endif
                            </span>
                                    </td>
                                    <!--<td class="bg_77">-->
                                    <!--    <a href="{{ route('userLog', '') . '/' . $data->id }}" class="qiang-btn" target="_blank"> 领取记录 </a>-->
                                    <!--</td>-->
                                    <td class="bg_88"><a class="starbtn2" href="{{$data->url}}" target="_blank" >进入游戏</a></td>
                                </tr>
                            @endif
                        @endforeach

                    </table>

                </div>
                <div style="clear:both;"></div>
            </div>
        </div>




    <!--</div>-->
    <div style="clear: both;"></div>
    <div class="footer fl">
    <div class="main">

        <div class="coinfo fl">
            <a href="#" title="XX游戏" class="coinfo-logo fl"><img src="images/bomlogo.jpg" style="margin-top: -19px;"></a>
            <div class="info fl">
                <p class="info-bt">
                    <a href="#" target="_blank">关于我们</a>
                    <i>|</i>
                    <a href="#" target="_blank">防沉迷系统</a>
                    <i>|</i>
                    <a href="#" target="_blank">游戏纠纷处理</a>
                    <i>|</i>
                    <a href="#" target="_blank">用户协议</a>
                    <i>|</i>
                    <a href="#" target="_blank">家长监护</a>
                    <i>|</i>
                    <a href="#" target="_blank">技术安全保障措施</a>
                    <!-- <i>|</i>
                    <a href="https://beian.miit.gov.cn" style="margin-right: 7px;" target="_blank">鄂ICP备2021008450号</a> -->
                </p>
            </div>
            <div class="legal-list fl">
{{--                <a href="#" target="_blank" class="legal-1">互联网文化</br>经营单位</a>--}}
{{--                <a href="#" target="_blank" class="legal-2">工商</br>行政管理局</a>--}}
{{--                <a href="#" target="_blank" class="legal-3">互联网</br>公安</a>--}}
            </div>
        </div>
    </div>
</div>
</div>
<div style="clear: both;"></div>
<!--<script src="https://logo.szjfxj.com/api/jslicense/66ad246d40553840"></script>-->
<!-------底部-------->


<!-------右侧浮动-------->
<div class="float-menu">
    <!--<a href="http://wpa.qq.com/msgrd?v=3&uin=2880869155&site=qq&menu=yes" class="fm-m2">

        <p class="fm-m2-box">
            <span>点击联系在线客服</span>
            <i class="fm-txt">在线<br>客服</i>
            <em></em>
        </p>
    </a>
    <a href="http://wpa.qq.com/msgrd?v=3&uin=2880869153&site=qq&menu=yes" class="fm-m1">
        <p class="fm-m1-box">
            <span>2880869153</span>
            <i class="fm-txt">客服<br>QQ</i>
            <em></em>
        </p>
    </a>-->
    <a href="javascript:;" class="fm-m4">
        <p class="fm-m4-box">
            <!--<span class="fm-m4-ewm"><img src="images/weixin.jpg" width="104" height="104"/></span>-->
            <i class="fm-txt">官方<br>微信</i>
            <script async id="dueroCustomerWxScript" src="https://kf-im-tx.dustess.com/customer-service/sdk/customer-service-im-js-sdk.js?sysNum=VzAwMDAwMDE4MjYyLDYzZjU3NGRiZTRiMDJlNzE5MzE0Zjc0ZQ==&openKfId=wkJawBCQAAAWZtSWjdtxwJzWdPyumWcw&webType=0&sceneType=1"></script>
            <em></em>
        </p>
    </a>
    <!--<a href="http://wpa.qq.com/msgrd?v=3&uin=2880869154&site=qq&menu=yes" class="fm-m3">-->
    <!--    <p class="fm-m3-box">-->
    <!--        <span>点击联系投诉建议</span>-->
    <!--        <i class="fm-txt">投诉<br>建议</i>-->
    <!--        <em></em>-->
    <!--    </p>-->
    <!--</a>-->

    <a href="javascript:" target="_self" onclick="gotoTop();return false;" class="fm-m5"></a>
</div>
<div class="rightbar2">

		<ul class="downlist">
			<li><a href="https://wwnw.lanzouh.com/ibp2w0kc5u0d" target="_blank"></a></li>
		</ul>
</div>

<script src="{{ asset('/js/jquery.qrcode.min.js') }}"></script>
<script src="{{ asset('/js/main.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/jquery.SuperSlide.2.1.1.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/public.js') }}"></script>

<script type="text/javascript">
    $(function () {


        jQuery('.slideBox').slide({mainCell:'.bd ul',effect:'fold',autoPlay:true,pnLoop:false});
        $('.kf-nav li').hover(function(){
            var _index = $(this).index();
            $(this).addClass('cur').siblings().removeClass('cur');
            $(".kf-list-txt").hide().eq(_index).show();
        }).eq(0).trigger('hover');
        $('.news-nav li').hover(function(){
            var _index = $(this).index();
            $(this).addClass('cur').siblings().removeClass('cur');
            $('.news-list-txt').hide().eq(_index).show();
        }).eq(0).trigger('hover');
        jQuery('.picScroll-left').slide({titCell:'.hd ul',mainCell:'.bd ul',autoPage:true,effect:'leftLoop',vis:6,trigger:'click'});
    });

</script>


    <script type="text/javascript">
        var dom = document.querySelector(".number")
        var digit = new Digit({
            number : 1888888.88, // 到达指定数值停止滚动
            finish : 5, // 整体完成时间
            speed : 1, // 数值越大，越多数字同时进行翻滚，取值范围（1 ~ 10）
            direction : "right", // 动画方向
            dom : dom, // 在指定dom节点插入动画
        })

        digit.render() // 执行
    </script>

<script type="text/javascript">

$(function(){

    $(".rotate-con-zhen").rotate({
        bind:{
            click:function(){
                // alert('系统维护.请半小时后在操作');
                // return
                let _this = this;
                // 获取今日抽奖情况
                sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                    if (res.data === false) {
                        // 接口获取服务器
                        sendRequest('POST', '{{route("draws", '')}}', {}, function (res) {
                            $(_this).rotate({
                                duration:3000,               //转动时间
                                angle: 0,                    //起始角度
                                animateTo:1440+res.data.anger,      //结束的角度
                                easing: $.easing.easeOutSine,//动画效果，需加载jquery.easing.min.js
                                callback: function(){
                                    layer.open({
                                        content: res.message,
                                        yes: function(index, layero){
                                            //do something
                                            layer.close(index); //如果设定了yes回调，需进行手工关闭
                                            // 打开提交账号页面
                                            if (res.data.is_luck === 1) {
                                                openCommitDrawPage(res.data.id)
                                            }
                                        }
                                    });
                                }
                            });
                        })
                        return;
                    } else if (res.data.is_luck === 1 && res.data.game_num === '') {
                        openCommitDrawPage(res.data.id)
                    } else if (res.data.is_luck === 1 && res.data.status === 3) {
                        // 异常了
                        layer.alert(`您提交中奖信息异常，异常原因：【${res.data.msg}】, 请重新提交信息`, {
                            closeBtn: 0
                        }, function(){
                            openCommitDrawPage(res.data.id)
                        });
                    } else if (res.data.is_luck === 1 && res.data.status === 2) {
                        layer.alert(`您的中奖信息正在处理中，请耐心等待`, {
                            closeBtn: 0
                        });
                    } else if (res.data.is_luck === 1 && res.data.status === 1) {
                        layer.alert(`您的中奖信息已处理完成，请注意查收`, {
                            closeBtn: 0
                        });
                    } else {
                        layer.msg('大侠今日与大奖擦肩而过，请明日再来');
                    }

                })

            }
        }
    });

});

function openCommitDrawPage(id) {
    layer.open({
        type: 2,
        title: "领取信息",
        content: "{{route('getCommitDrawPage', '')}}/"+id,
        scrollbar: false,
        area: ['700px', '600px'],
        cancel: function(index, layero){
            if(confirm('你没有填写账号和游戏，无法领取奖励，确定关闭吗')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index)
            }
            return false;
        }
    })
}

</script>

<script>


    function getOpenDate(id, game, money, total, current) {
        sendRequest('GET', '{{route("getGameServer", '')}}/' + id, {}, function (res) {
            open_commit_box(id, game, money, total, current, res.data)
        })
    }

    function open_commit_box(id, game, money, total, current, serverList) {
        checkLogin();
        let titleHtml = `
<div class="game-money">
   ${money}
</div>
<div class="game-name">
   ${game}
</div>
<div class="get-num">
   数量：${current}/${total}
</div>
            `

        let formHtml = `
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="row">
                        <div class="col-lg-12" style="text-align: center;">
                            ` + titleHtml + `
                        </div>
                        <form class="layui-form" action="">
                            <input type="hidden" name="game_id" value="${id}">
                            <div class="layui-form-item">
                                <label class="layui-form-label">游戏账号:</label>
                                <div class="layui-input-block">
                                    <input type="text" name="game_num" required  lay-verify="required" placeholder="请输入游戏账号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认账号:</label>
                                <div class="layui-input-block">
                                    <input type="text" name="game_num_re" required  lay-verify="required" placeholder="请确认游戏账号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">游戏名称:</label>
                                <div class="layui-input-block">
                                    <select name="server_id" lay-verify="required" id="server-val"></select>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">验证码:</label>
                                    <div class="layui-input-inline" style="width: 100px;">
                                        <input type="text" name="captcha" autocomplete="off" class="layui-input" id="captcha">
                                    </div>
                                </div>
                                <img src="{{captcha_src()}}" id="captcha_img" onclick="this.src='{{captcha_src()}}'+Math.random()">
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            `
        layer.open({
            type: 1,
            content: formHtml,
            area: ['500px', '600px'],
            title: '提交账号'
        })
        $.each(serverList, function (index, object) {
            let dis = object.is_disable ? '' : 'disabled';
            let checked = object.is_checked ? ' selected="selected""' : '';
            console.log(object.server_name, checked)
            $('#server-val').append(`<option value="${object.id}" ${dis} ${checked}>${object.server_name}(${object.open_server_time.substr(0,5)})</option>`);
        });
        layui.use('form', function(){
            let form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
            form.render('select');
        });

    }

    layui.use('form', function(){
        let form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
        form.on('submit(formDemo)', function(data){
            console.log(data.field);
            sendRequest('POST', '{{route("commitForm", "")}}',data.field, function (response) {
                if (response.success === 'true') {
                    successMsg("领取成功");
                    setTimeout(function () {
                        window.location.reload()
                    }, 2000)
                } else {
                    errorMsg(response.message, function () {
                        $('#captcha_img').attr('src', '/captcha/default?' + '?' + Math.random());
                    });
                }
            })
            return false;
        });
    });


    // 登录页面
    function openLoginWin() {
        layer.open({
            type: 2,
            title: "登录",
            content: "{{route('loginPage', '')}}",
            scrollbar: false,
            area: ['500px', '350px'],
            cancel: function(index, layero){
                layer.close(index)
                return false;
            }
        })
    }

    // 二维码切换验证码登录
    function goMobileLogin() {
        clearInterval(timeController);
        layer.closeAll();
        openLoginWin()
    }

    (function (w, d, e, x) {
        w[e] = function () {
        w.cbk = w.cbk || [];
        w.cbk.push(arguments);
        };
        x = d.createElement('script');
        x.async = true;
        x.id = 'dueroCustomerWxScript';
        x.src = 'https://kf-im-tx.dustess.com/customer-service/sdk/customer-service-im-js-sdk.js?sysNum=VzAwMDAwMDE4MjYyLDYzZjU3NGRiZTRiMDJlNzE5MzE0Zjc0ZQ==&openKfId=wkJawBCQAAAWZtSWjdtxwJzWdPyumWcw&webType=0&sceneType=1';
        d.body.appendChild(x);
      })(window, document, 'cf');

    $(function () {
        $('.go-recharge-btn').click(function () {
            sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                location.href = '/userCenter?type=recharge'
            })
        })
        $('.go-dh-btn').click(function () {
            sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                location.href = '/userCenter?type=dh'
            })
        })
        $('#WeChatLogin').click(function () {
            openLoginPage()
        })
        $('#outLogin').click(function () {
            sendRequest('POST', '{{route("login.loginOut", '')}}', {}, function (res) {
                location.reload()
            })
        })

    })

</script>

    <style>
        .layui-layer-page, .layui-layer-dialog, .layui-layer-iframe {
            top: 150px !important;
        }
    </style>


<style>
    .game-money {
        font-size: 30px;
        color: red;
    }
    .game-money span {
        font-size: 26px;
    }

    .game-name {
        font-weight: 900;
        font-size: 20px;
    }
    #qrcode {
        text-align: center;
    }
</style>

</body>
</html>
@endsection
